<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta content="webkit" name="renderer" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="keywords" content="PoweredByJeeSiteV4.0" />
    <meta
      http-equiv="Cache-Control"
      content="no-cache, no-store, must-revalidate"
    />
    <meta name="description" content="PoweredByJeeSiteV4.0" />
    <meta content="no-cache" http-equiv="Pragma" />
    <meta http-equiv="Expires" content="0" />
    <meta
      content="width=device-width, initial-scale=1, user-scalable=1"
      name="viewport"
    />
    <title>设备表管理 - 中药材生产管理全程追溯系统</title>
    <!--<link rel="shortcut icon" href="https://gap.ycgap.cn//fujiangap/static/yunyc_favicon.ico" type="image/x-icon">-->
    <script src="https://gap.ycgap.cn//fujiangap/global.min.js?ctx=https://gap.ycgap.cn//fujiangap/a"></script>
    <script src="https://gap.ycgap.cn//fujiangap/static/jquery/jquery-1.12.4.min.js"></script>
    <!-- <script src="https://gap.ycgap.cn//fujiangap/static/jquery/jquery-migrate-1.4.1.min.js"></script> -->
    <!--[if lt IE 9
      ]><script src="https://gap.ycgap.cn//fujiangap/static/common/h5fix.min.js"></script
    ><![endif]-->
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/fonts/font-icons.min.css"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/bootstrap/css/bootstrap.min.css"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/select2/4.0/select2.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/icheck/1.0/minimal/grey.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/jqGrid/4.7/css/ui.jqgrid.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/webuploader/0.1/webuploader.extend.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/adminlte/css/AdminLTE.min.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/common/jeesite.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/adminlte/css/skins/skin-blue.css?V1.1-12041540"
    />
    <link
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/common/common.css?V1.1-12041540"
    />
    <link
      type="text/css"
      rel="stylesheet"
      href="https://gap.ycgap.cn//fujiangap/static/css/view/list.css"
    />
    <!--<link type="text/css" rel="stylesheet"  href="https://gap.ycgap.cn//fujiangap/static/css/view/skin_white.css"/>-->
  </head>
  <body class="hold-transition">
    <div class="videowrap">
        <div class="video">
          <video
            id="video0"
            poster=""
            autoplay
            playsinline
            webkit-playsinline
          >
            <source
              src="https://open.ys7.com/v3/openlive/L03997520_4_2.m3u8?expire=1735264872&id=662233928555307008&t=c47653c473143060f9173ecf261de0a06ad268429f144d4d9d09aa49c4b32b56&ev=100"
              type=""
            />
          </video>
        </div>
        <div class="video-btn">
          <span onclick="setDirection(0,true)">上</span
          ><span onclick="setDirection(1,true)">下</span
          ><span onclick="setDirection(2,true)">左</span
          ><span onclick="setDirection(3,true)">右</span
          ><span onclick="setDirection(8,true)">放大</span
          ><span onclick="setDirection(9,true)">缩小</span
          ><span onclick="setDirection(null,false)">停止</span
          ><span onclick="clickFullScreen();" class="btn-qp">全屏</span
          ><span onclick="clickBackScreen();" class="btn-hy">还原</span>
        </div>
      </div>


    <div class="wrapper">
      <link
        type="text/css"
        rel="stylesheet"
        href="https://gap.ycgap.cn//fujiangap/static/css/view/view.css"
      />
      <link
        type="text/css"
        rel="stylesheet"
        href="https://gap.ycgap.cn//fujiangap/static/css/video/video.css"
      />
      <!--<script src="https://gap.ycgap.cn//fujiangap/static/js/video/ezuikit.js"></script>-->
      <script src="https://gap.ycgap.cn//fujiangap/static/js/video/ezuikit-3.js"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/js/video/cyberplayer.js"></script>
      <style>
        #CuPlayerVideo_video_object {
          display: block;
          margin: 10px auto;
        }
      </style>


      <a id="scroll-up" href="#" class="btn btn-sm"
        ><i class="fa fa-angle-double-up"></i
      ></a>
      <script src="https://gap.ycgap.cn//fujiangap/static/bootstrap/js/bootstrap.min.js"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/select2/4.0/select2.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/select2/4.0/i18n/zh_CN.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/layer/3.1/layer.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/laydate/5.0/laydate.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jqGrid/4.7/js/jquery.jqGrid.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jqGrid/4.7/js/jquery.jqGrid.extend.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jqGrid/4.7/js/i18n/zh_CN.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jquery-validation/1.16/jquery.validate.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jquery-validation/1.16/localization/messages_zh_CN.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jquery-validation/1.16/jquery.validate.extend.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/webuploader/0.1/webuploader.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/webuploader/0.1/webuploader.extend.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/webuploader/0.1/i18n/zh_CN.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/jquery/jquery-ui-sortable-1.12.1.min.js"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/common/jeesite.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/common/i18n/jeesite_zh_CN.js?V1.1-12041540"></script>
      <script src="https://gap.ycgap.cn//fujiangap/static/common/common.js?V1.1-12041540"></script>
      <script>
        $("#deviceCheckDataGrid").dataGrid({
          data: [],
          datatype: "local", // 设置本地数据
          autoGridHeight: function () {
            return "auto";
          }, // 设置自动高度
          columnModel: [
            {
              header: "校准单位",
              name: "calibrationUnit",
              index: "a.calibration_unit",
              width: 250,
              align: "center",
            },
            {
              header: "证书编号",
              name: "certificateNumber",
              index: "a.certificate_number",
              width: 250,
              align: "center",
            },
            {
              header: "校验日期",
              name: "certificateTime",
              index: "a.certificate_time",
              width: 250,
              align: "center",
            },
            {
              header: "有效期",
              name: "effectiveTime",
              index: "a.effective_time",
              width: 250,
              align: "center",
            },
            {
              header: "检定依据",
              name: "basis",
              index: "a.basis",
              width: 250,
              align: "center",
            },
            {
              header: "检定结果",
              name: "results",
              index: "a.results",
              width: 250,
              align: "center",
            },
          ],
        });

        $("#useLogDataGrid").dataGrid({
          data: [],
          datatype: "local", // 设置本地数据
          autoGridHeight: function () {
            return "auto";
          }, // 设置自动高度
          columnModel: [
            {
              header: "工作事项",
              name: "workMatters",
              index: "a.work_matters",
              width: 350,
              align: "center",
            },
            {
              header: "使用时间开始",
              name: "useTimeBegin",
              index: "a.use_time_begin",
              width: 350,
              align: "center",
              formatter: "date",
              formatoptions: { srcformat: "Y-m-d H:i:s", newformat: "Y-m-d" },
            },
            {
              header: "使用时间结束",
              name: "useTimeEnd",
              index: "a.use_time_end",
              width: 350,
              align: "center",
              formatter: "date",
              formatoptions: { srcformat: "Y-m-d H:i:s", newformat: "Y-m-d" },
            },
            {
              header: "使用人",
              name: "employee.empName",
              index: "a.use_people",
              width: 350,
              align: "center",
            },
          ],
        });

        $("#devicesMaintainDataGrid").dataGrid({
          data: [],
          datatype: "local", // 设置本地数据
          autoGridHeight: function () {
            return "auto";
          }, // 设置自动高度
          columnModel: [
            {
              header: "养护时间",
              name: "insertTime",
              index: "a.insert_time",
              width: 350,
              align: "center",
              formatter: "date",
              formatoptions: { srcformat: "Y-m-d H:i:s", newformat: "Y-m-d" },
            },
            {
              header: "养护类型",
              name: "maintainType",
              index: "a.maintain_type",
              width: 350,
              align: "center",
              formatter: function (val, obj, row, act) {
                return js.getDictLabel(
                  [
                    {
                      cssClass: "",
                      dictValue: "1",
                      cssStyle: "",
                      dictLabel: "保养",
                    },
                    {
                      cssClass: "",
                      dictValue: "2",
                      cssStyle: "",
                      dictLabel: "维护",
                    },
                  ],
                  val,
                  "",
                  true
                );
              },
            },
            {
              header: "仪器异常描述",
              name: "maintainContent",
              index: "a.maintain_content",
              width: 350,
              align: "center",
            },
          ],
        });

        $("#inputForm").validate({
          submitHandler: function (form) {
            js.ajaxSubmitForm(
              $(form),
              function (data) {
                js.showMessage(data.message);
                if (data.result == Global.TRUE) {
                  js.closeCurrentTabPage(function (contentWindow) {
                    contentWindow.page();
                  });
                }
              },
              "json"
            );
          },
        });

        var deviceSerial = "L03997520";
        var channelNo = "4";
        var accessToken =
          "at.7ypj7xpk1pzd2lzidyhdi7xuceda3hi1-2obkwsiddu-10nhzxa-elxxk4yz2";
        var direction = 1;
        var ezopenPlayer;

        $(document).ready(function () {
          $("#uploadImage").hide();

          var classify = "02";
          var paramYsyUrl =
            "https://open.ys7.com/v3/openlive/L03997520_4_2.m3u8?expire=1735264872&id=662233928555307008&t=c47653c473143060f9173ecf261de0a06ad268429f144d4d9d09aa49c4b32b56&ev=100";
          var paramYsyUrlHd = "";
          console.log(paramYsyUrl);
          if (classify == "02" && (paramYsyUrl != "" || paramYsyUrlHd != "")) {
            if (
              paramYsyUrl.startsWith("ezopen") ||
              paramYsyUrlHd.startsWith("ezopen")
            ) {
              ezopenPlayer = new EZUIKit.EZUIKitPlayer({
                id: "video0", // 视频容器ID
                accessToken: accessToken,
                url: "https://open.ys7.com/v3/openlive/L03997520_4_2.m3u8?expire=1735264872&id=662233928555307008&t=c47653c473143060f9173ecf261de0a06ad268429f144d4d9d09aa49c4b32b56&ev=100",
                template: "simple", // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题；
                width: 500,
                height: 350,
              });
            } else {
              var player = new EZUIKit.EZUIPlayer("video0");
            }
          }

          var ysyAppKey = "dbd0d82bfc674202a0498b2643679200";
          var ysySecret = "7941cdd3a51b39699a00d63113c5f101";
          if (accessToken != null && accessToken == "") {
            getYsyAccessToken(ysyAppKey, ysySecret);
          }
        });

        function getYsyAccessToken(ysyAppKey, ysySecret) {
          if (
            ysyAppKey != null &&
            ysyAppKey != "" &&
            ysySecret != null &&
            ysySecret != ""
          ) {
            $.ajax({
              type: "POST",
              url:
                "https://open.ys7.com/api/lapp/token/get?appKey=" +
                ysyAppKey +
                "&appSecret=" +
                ysySecret,
              dataType: "json",
              success: function (data) {
                console.log(data);
                if ((data.code = "200")) {
                  var data1 = data.data;
                  if (data1 != null && data1 != "") {
                    accessToken = data1.accessToken;
                    var expireTime = data1.expireTime;
                    saveYsyAccessToken(ysyAppKey, accessToken, expireTime);
                  }
                }
              },
            });
          }
        }

        function saveYsyAccessToken(ysyAppKey, accessToken, expireTime) {
          if (
            ysyAppKey != null &&
            ysyAppKey != "" &&
            accessToken != null &&
            accessToken != "" &&
            expireTime != null &&
            expireTime != ""
          ) {
            $.ajax({
              type: "POST",
              url:
                "https://gap.ycgap.cn//fujiangap/a/devices/devices/saveYsyAccessToken?appKey=" +
                ysyAppKey +
                "&accessToken=" +
                accessToken +
                "&expireTime=" +
                expireTime,
              dataType: "json",
              success: function (data) {
                console.log(data);
              },
            });
          }
        }

        var setDirection = function (dir, flag) {
          /*if(dir){
                direction = dir;
            }*/
          if (dir != null) {
            direction = dir;
          }
          stopControl(accessToken, deviceSerial, channelNo, direction, flag);
        };
        //全屏
        var clickFullScreen = function () {
          $(".videowrap").addClass("cur");
          ezopenScreen(1);
        };
        //还原
        var clickBackScreen = function () {
          $(".videowrap").removeClass("cur");
          ezopenScreen(2);
        };

        function ezopenScreen(flag) {
          if ("#ezopen_ele".length > 0) {
            var width = $(".videowrap.cur").width() + "px";
            var height = $(".videowrap.cur").height() + "px";
            var canvasWidth = width;
            if (flag == 2) {
              width = $(".videowrap").width() + "px";
              height = $(".videowrap").height() + "px";
              canvasWidth = width;
            } else {
              canvasWidth = $(".videowrap.cur").width() - 500 + "px";
            }
            $("#video0-wrap").css("width", width);
            $("#video0-wrap").css("height", height);

            $("#video0").css("width", width);
            $("#video0").css("height", height);

            $("#video0 > .video0parent-wnd > div").css("width", width);
            $("#video0 > .video0parent-wnd > div").css("height", height);

            $("#video0canvas0").attr({ width: canvasWidth, height: height });
            $("#video0canvas0").css("width", canvasWidth);
            $("#video0canvas0").css("height", height);

            if (flag == 1) {
              $("#video0canvas0").css("margin-left", "15%");
            } else {
              $("#video0canvas0").css("margin-left", "");
            }
          }
        }
        //开始云台控制
        var beginControl = function (
          accessToken,
          deviceSerial,
          channelNo,
          direction,
          speed
        ) {
          //0-上，1-下，2-左，3-右，4-左上，5-左下，6-右上，7-右下，8-放大，9-缩小，10-近焦距，11-远焦距
          $.ajax({
            type: "POST",
            contentType: "application/x-www-form-urlencoded",
            url: "https://open.ys7.com/api/lapp/device/ptz/start",
            data: {
              accessToken: accessToken,
              deviceSerial: deviceSerial,
              channelNo: parseInt(channelNo),
              direction: parseInt(direction),
              speed: parseInt(speed),
            },
            dataType: "json",
            success: function (data) {
              console.log(data);
              if (data.code == "200") {
                console.log("开始云台控制成功");
              } else {
                console.log("开始云台控制失败," + data.msg);
              }
            },
          });
        };

        //停止云台控制
        var stopControl = function (
          accessToken,
          deviceSerial,
          channelNo,
          direction,
          flag
        ) {
          $.ajax({
            type: "POST",
            contentType: "application/x-www-form-urlencoded",
            url: "https://open.ys7.com/api/lapp/device/ptz/stop",
            data: {
              accessToken: accessToken,
              deviceSerial: deviceSerial,
              channelNo: parseInt(channelNo),
              direction: parseInt(direction),
            },
            dataType: "json",
            success: function (data) {
              console.log(data);
              console.log(
                "accessToken:" +
                  accessToken +
                  "---deviceSerial:" +
                  deviceSerial +
                  "---channelNo:" +
                  channelNo +
                  "---direction:" +
                  direction
              );
              if (data.code == "200") {
                console.log("停止云台控制成功");
                if (flag == true) {
                  //0-慢，1-适中，2-快
                  beginControl(
                    accessToken,
                    deviceSerial,
                    channelNo,
                    direction,
                    1
                  );
                  /*if(parseInt(direction) < 4){
    
                            }*/
                  setTimeout(function () {
                    console.log("--------->定时停止");
                    stopControl(
                      accessToken,
                      deviceSerial,
                      channelNo,
                      direction,
                      false
                    );
                  }, 1000);
                }
              } else {
                console.log("停止云台控制失败," + data.msg);
              }
            },
          });
        };

        //乐橙控制视频//0-上，1-下，2-左，3-右，4-左上，5-左下，6-右上，7-右下，8-放大，9-缩小，10-停止
        function lcControl(operation) {
          $.ajax({
            type: "POST",
            url:
              "https://gap.ycgap.cn//fujiangap/a/devices/devices/lcControl?id=1742005473574694912&operation=" +
              operation,
            dataType: "json",
            success: function (json) {
              console.log(json);
            },
          });
        }
      </script>
    </div>
  </body>
</html>
